<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
<title>运营平台</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="renderer" content="webkit">
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/common.css?v=20170207" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/table.css?v=20170117" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/jquery-ui.css" />
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-1.11.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ui.min.js" type="text/javascript"></script>
 <script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/yunIndex.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ym-datePlugin-0.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/global.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/cheshan/js/common.js" type="text/javascript"></script>
<script type="text/javascript" src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery.placeholder.min.js"></script>
<script type="text/javascript">
 $(function(){
     $("input").placeholder();
     if (navigator.userAgent.indexOf("Safari") > -1) {
       $("input").css("lineHeight","normal !important");
     };
});
</script>

<style type="text/css">
    .dlv,.msg_content{width:100%;font-size:12px;border:1px solid #ccc; resize:none;}
    #tr_show{display:block;width:1020px;}
    .dealer_list{width:200px;height: 200px;float:left;border: 1px solid #ccc;display:block;overflow-y: scroll; background:#fff;}
    .dealer_list_tit{height:30px;line-height:30px;border-bottom: 1px solid #ccc; background:#f6f6f6;vertical-align:middle;}
    .dealer_list_tit input[name=selectAll]{margin:9px 0 0 10px;float:left;}
    .dealer_list_tit input[name=selectTrue]{border:none; background:#20ab4f;color:#fff;border-radius:3px;width:40px;height:22px; line-height:22px;margin-top:4px;}
    .dealer_list_tit label{margin-left:5px;}
    .dealer_list_con{padding:5px 0;}
    .dealer_list_con label{float:left;padding-left:10px;height:20px; line-height:20px; display:block;width:90%;}
    .dealer_list_con label input{float:left;margin:5px 5px 0 0;}
    #select_dealer{padding:5px;width:600px;height:190px; overflow-y:scroll;float:left;margin-right:30px;}
    .xin-text{width:150px;height:22px;border:solid 1px #c8c8c8; text-align:left;padding:0 10px;margin:0 5px;}
    .msg .xin-text1{width:150px;height:22px;border:solid 1px #c8c8c8; text-align:left;padding:0 10px;margin:0 5px; background:#fff url(http://img1.isou365.cn/paimai/yunying/images/zhong_pic.jpg) no-repeat 148px 3px; cursor:pointer;}
    #tr_show .tr-xuan{width:100px;float:left;}
    .msg{ background:#f6f6f6;width:1018px;margin-top:10px;padding-top:20px;border:solid 1px #e7e7e7;}  
    .duanxin{padding:10px;border-top:solid 1px #e7e7e7;margin-top:20px; text-align:left;border-bottom:solid 1px #e7e7e7;}
    .duanxin span{ display:block;float:left;padding-top:4px;width:100px; height:30px;}
    /*    .dlv,.msg_content{width:100%;font-size:12px;border:1px solid #ccc; resize:none;}
        .msg_content{}
        #tr_show{display:none;}
        .dealer_list{width:150px;height: 200px;float:left;border: 1px solid #ccc;display:none;overflow:auto;}
        .dealer_list_tit{height:30px;line-height:30px;border-bottom: 1px solid #ccc;}
    
        .dealer_list_con{height:20px;line-height:20px;}
        .dealer_list_tit label,.dealer_list_con label{float:left;padding-left:10px;}*/
</style>
</head>
<body>
<div class="header">
<div class="headerCo">
<span>你好,<?php echo ($user_info["real_name"]); ?><a href="<?php echo (WEB_URL); ?>Emp/logout">退出</a></span>
<h1><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_logo.jpg"></h1>
</div>
</div>
<div class="mian">
    <div class="mianL">
    <dl>
        <dd>
            <a id="menu_sy" href="/Index/index" class="shouye">首页</a>
        </dd>
        <?php foreach ($tree_menu as $key => $value): ?>
          <dd>
            <span id="menu_<?php echo ($value['first_char']); ?>" ><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_jia.jpg"><?php echo ($value['name']); ?></span>
            <ul style="display: none;">
                <?php if (!empty($value['children'])): ?>
                    <?php foreach ($value['children'] as $k => $v): ?>
                        <li><a id='menu_<?php echo ($v["first_char"]); ?>' href="<?php echo ($v['url']); ?>"><?php echo ($v['name']); ?></a></li>
                    <?php endforeach ?>
                <?php endif ?>
            </ul>
        <?php endforeach ?>
    </dl>
</div>

<?php $menu = 'nrgl.qfdx'; ?>
<?php $menu=json_encode(explode('.', $menu)); ?>
<script>
    $(function () {
        var cur_menu = '<?php echo ($menu); ?>', cur_menu = eval('[' + cur_menu + ']'), cur_menu = cur_menu[0];
        if (cur_menu == "sy") {
            $("#menu_sy").removeClass('shouye').addClass('current');
        }
        $('#menu_' + cur_menu[0]).click();
        $('#menu_' + cur_menu[0]).find("img").attr("src", "http://img1.isou365.cn/paimai/yunying/images/yun_jie.jpg");
        $(".mianL").css("height", $(document).height() - 95);
        $('#menu_' + cur_menu[1]).addClass('current');
    });
</script>

    <div class="mianR">
        <h3 class="yonghu">群发短信</h3>
        <div class="msg">
            <div id="tr_show">
                <label for="select_dealer" class="tr-xuan">请选择车商：</label>
                <textarea id="select_dealer" class="dlv" type="text" name="dealer_list_value" placeholder="请选择车商联系人" readonly="readonly"></textarea> 
                <div class="dealer_list">
                    <div class="dealer_list_tit">
                        <label><input name="selectAll" type="checkbox" onclick="selectAll(this);">全部</label>
                        <label><input name="selectTrue" type="button"  onclick="selectTrue();" value="确定"></label>
                    </div>
                    <div class="dealer_list_con">
                        <?php if(is_array($dealer)): $i = 0; $__LIST__ = $dealer;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$dealer): $mod = ($i % 2 );++$i;?><label>
                                <input name="dealer_mobile" type="checkbox" value="<?php echo ($dealer["contact_mobile"]); ?>" dealer-name="<?php echo ($dealer["contact_person"]); ?>">
                                <span><?php echo ($dealer["contact_person"]); ?></span>
                            </label></br><?php endforeach; endif; else: echo "" ;endif; ?>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="duanxin">
                    <label for="input_message">请输入短信内容：</label>
                    【来拍车】尊敬的会员：
                    您关注的<input type="text" name="car_list" value="" placeholder="请输入车型名称">等车型，
                    将于<input type="text" name="scene_name" id="demoText9" class="xiaci xin-text1" value="" placeholder="请输入拍卖时间" readonly >的时间开拍，敬请关注！
                    <!--<textarea id="input_message" class="msg_content" type="text" name="msg_content" placeholder="请输入短信内容"></textarea>-->
                </div>
                <div class="yongBtn1">
                    <input type="button" value="发送" class="queding sendMessage" />
                </div>
            </div>
            <div class="clear"></div>
            <script type="text/javascript">
                /**
                 * 全选
                 */
                function selectAll(checkbox) {
                    $('.dealer_list_con input[type=checkbox]').prop('checked', $(checkbox).prop('checked'));
                }
                /**
                 * 确定选择
                 */
                function selectTrue() {
                    var obj = $(".dealer_list_con input[name='dealer_mobile']:checked");
                    var obj_len = obj.length;
                    if (obj_len > 0) {
                        obj.each(function (i, v) {
                            if (0 == i) {
                                dealer_list = $(v).siblings('span').html()+" "+$(v).val()+",";
                                dealer_mlist = $(v).val();
                            } else {
                                if(i%2 == 1){
                                    dealer_list +=  $(v).siblings('span').html()+" "+$(v).val()+","+"\n";
                                    dealer_mlist += "," + $(v).val();
                                }else{
                                    dealer_list +=  $(v).siblings('span').html()+" "+$(v).val()+",";
                                    dealer_mlist += "," + $(v).val();
                                }  
                            }
                        });
                        $("#select_dealer").html(dealer_list);
//                        $("#tr_show,.dealer_list").hide();
                    } else {
                        shibai_alert("请选择车商联系！");
                    }
                }
//                $("#select_dealer").on("focus", function () {
//                    $("#tr_show,.dealer_list").show();
//                });
                /**
                 * 发送列表邮箱
                 */
                $('.sendMessage').on('click', function () {
                    select_dealer = $("#select_dealer").val();
                    scene_name = $("input[name='scene_name']").val();
                    car_list = $("input[name='car_list']").val();
                    if (select_dealer == '') {
                        shibai_alert("请选择车商联系");
                        return false;
                    }
                    if (scene_name == '') {
                        shibai_alert("请输入拍卖时间");
                        return false;
                    } else if (car_list == '') {
                        shibai_alert("请输入车型名称");
                        return false;
                    }
                    var param = {
                        "dealer_mlist": dealer_mlist,
                        "scene_name": scene_name,
                        "car_list": car_list
                    }
                    $.post("<?php echo U('GroupMessage/messageSend');?>", param, function (data) {
                        if (data.code == '200') {
                            btn_alert(data.msg, 2000, function () {
                                window.location.href = "<?php echo U('GroupMessage/index');?>";
                            });
                        } else {
                            shibai_alert(data.msg);
                        }
                    }, 'json');
                });
            </script>
            <div class="yunBei"></div>
<div class="loading"></div>
</body>
</html>